package com.v2.k2;

import com.v2.k1.User;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.annotation.AnnotatedBeanDefinitionReader;

/**
 * 测试AnnotatedBeanDefinitionReader  将某个类转换为BeanDefinition，并且会解析该类上的注解
 */
public class Test1 {

	public static void main(String[] args) {

		DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
		AnnotatedBeanDefinitionReader annotatedBeanDefinitionReader = new AnnotatedBeanDefinitionReader(beanFactory);

		annotatedBeanDefinitionReader.register(User.class);

		System.out.println(beanFactory.getBean("user"));
	}

}
